package edu.vt.ece.rt.benchmark.bst;

import java.util.ArrayList;
import java.util.Random;

import edu.vt.ece.rt.benchmark.list.List;
import edu.vt.ece.rt.dstm.TMProxy;
import edu.vt.ece.rt.quorum.ClustersManager;
import edu.vt.ece.rt.quorum.Resource;
import edu.vt.ece.rt.quorum.util.Names;
import edu.vt.ece.rt.util.Logger.Logger;


public class Benchmark extends edu.vt.ece.rt.benchmark.Benchmark{

	Random r = new Random();
	
	@Override
	protected void createLocalObjects() {

		BST dummy = new BST();
		try {
			new BST("size",(localObjectsCount)*(Integer.getInteger(Names.nodes)), null, null);
			dummy.createBtree(0, localObjectsCount);
			
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}

	@Override
	protected Object randomId() {
		return null;
	}
	
	
	@Override
	protected int getOperandsCount() {
		return 0;
	}

	@Override
	protected void readOperation(Object... ids) {
		
		int val = r.nextInt(localObjectsCount);
		BST.find(val, null);
	}

	@Override
	protected void writeOperation(Object... ids) {

		BST.closedNested(localObjectsCount);
		
	}

	@Override
	protected void checkSanity() {
		return;
	}


	@Override
	protected String getLabel() {
		return "bst-qr";
	}
	
}
